<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 对象新增API：Keys(),Values(),Entries()
        let person = {
            name:"wcj",
            age:24,
            language:["chinese","english","french"]
        }
        console.log(Object.keys(person));
        console.log(Object.values(person));
        console.log(Object.entries(person));
        // assign()方法，进行对象内容的拼接
        const target = {name:"bss"};
        const source1 = {age:24};
        const source2 = {gender:"女"}
        console.log(Object.assign(target,source1,source2));
        // 声明对象简写
        let name = "hhh";
        let age = 25;
        const person1 = {name,age};
        console.log(person1);
        // 对象函数属性的简写
        let person2 = {
            name:"ysj",
            eat:function(food){
                console.log(this.name+"在吃"+food);
            },
            // 箭头函数不能用this，会失效，得用对象
            eat2:food=>console.log(person2.name+"在吃"+food),
            eat3(food){
                console.log(this.name+"在吃"+food)
            }
        }
        person2.eat("苹果");
        person2.eat2("香蕉");
        person2.eat3("橘子");
    </script>
</body>
</html>